package de.leuphana.internet.view;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import de.leuphana.internet.model.Buch;
import de.leuphana.internet.model.Katalog;





/**
 * Servlet implementation class BuchServlet
 */
public class BuchServlet extends BuchladenServlet {
	private static final long serialVersionUID = 1L;
	
	private Buch buch;
	
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		buch = (Buch)request.getAttribute("buch");
		super.doGet(request, response);
	}
	
	protected void druckeKopf(String titel) {
		super.druckeKopf("Buchinformation");
	}

	@Override
	protected void druckeInhalt() {
		out.println("<b>" + buch.getBuchTitel() + "</b><br>");
        out.println(buch.getAutor() + "<br>");
        out.println(buch.getPreis() + " DM" + "<br>");
        out.println(buch.getVerlag() + " " + buch.getErscheinungsJahr() + "<br>");
        out.println("ISBN " + buch.getIsbn() + "<p>");
        out.println("Kurzbeschreibung: " + buch.getBeschreibung() + "</p>");
	}

}